package cn.iocoder.yudao.module.system.videostore.dto.product;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;

/**
 * 添加商品 DTO
 */
@Data
public class AddProductDTO implements Serializable {

    @Schema(description = "商家自定义商品ID，小店后台不作任何唯一性约束，开发者自行保证，一旦添加成功后该字段无法修改，最多128字符",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private String out_product_id;

    @Schema(description = "标题，最少3字符，最多60字符。文本内容规则请看注意事项", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "标题不能为空")
    private String title;

    @Schema(description = "副标题，最多18字符",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private String sub_title;

    @Schema(description = "主图，多张，列表，最少3张，最多9张。无形状尺寸要求，最终在商详页会显示为正方形", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "主图不能为空")
    private String[] head_imgs;

    @Schema(description = "发货方式，若为无需快递（仅对部分类目开放），则无需填写运费模版id。0:快递发货（默认），1:无需快递",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private Integer deliver_method;

    @Schema(description = "商品详情信息",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private DescInfoDTO desc_info;
//    private DescInfoDTO[] desc_info;

    @Schema(description = "商品类目，大小恒等于3（一二三级类目）",
            requiredMode = Schema.RequiredMode.REQUIRED, example = "")
    @NotNull(message = "商品类目不能为空")
    private CatsDTO[] cats;

    @Schema(description = "商品参数，部分类目有必填的参数，具体参考文档获取类目信息中的字段attr.product_attr_list[].is_required",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private AttrsDTO[] attrs;

    @Schema(description = "商品编码",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private String spu_code;

    @Schema(description = "品牌id，无品牌为“2100000000”",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "2100000000")
    private String brand_id;

    @Schema(description = "商品资质图片（最多5张）", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String[] qualifications;

    @Schema(description = "express_info", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private ExpressInfoDTO express_info;

    @Schema(description = "售后说明",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private String aftersale_desc;

    @Schema(description = "limited_info",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private LimitedInfoDTO limited_info;

    @Schema(description = "extra_service",
            requiredMode = Schema.RequiredMode.REQUIRED, example = "")
    @NotNull(message = "extra_service不能为空")
    private ExtraServiceDTO extra_service;

    @Schema(description = "skus 长度最少为1，最大为500",
            requiredMode = Schema.RequiredMode.REQUIRED, example = "")
    @NotNull(message = "skus不能为空")
    private SkusDTO[] skus;

    @Schema(description = "添加完成后是否立即上架。1:是；0:否；默认0",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "0")
    private Integer listing;

    @Schema(description = "售后地址id，使用地址管理相关接口进行添加或获取",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
    private AfterSaleInfoDTO after_sale_info;

}
